//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++

$Workfile: KLEDDEF.H $

$Date: 5/24/05 7:51a $

Abstract:  
     	    
Notes: 



--*/
#ifndef __KBDLED_H__
#define __KBDLED_H__

///////////////////////////////////////////////////////////////////////////////

#define	ZONE_ERROR			DEBUGZONE(0)
#define	ZONE_WARN			DEBUGZONE(1)
//#define	ZONE_INIT				DEBUGZONE(2)
#define	ZONE_FUNCTION		DEBUGZONE(3)
#define	ZONE_IOCTL				DEBUGZONE(4)
#define	ZONE_DEVICE			DEBUGZONE(5)
#define	ZONE_ACTIVITY		DEBUGZONE(6)

#define DEBUG_FUNC                      0
#define DEBUG_ERROR                    1

#if _MSC_VER < 1300
#define __FUNCTION__                    ""
#endif
#define __WFUNCTION__                   TEXT(__FUNCTION__)

///////////////////////////////////////////////////////////////////////////////

typedef struct _KBDLED_STATE {
	HANDLE					htKbdLedThread;	 // worker thread handle
    HANDLE	                hevStop;		 // event, when signaled the module is being shut down
    HANDLE                  hevKeyPressed;   // event, when signaled a key has been pressed
    HANDLE                  hevKeyBackLight; // event, when signaled a backlight mapped key has been pressed
    HANDLE			   hKbdLedPowerNotifyThread; 
} KBDLED_STATE, *PKBDLED_STATE;

///////////////////////////////////////////////////////////////////////////////

// IO control for set keypad backlight on/off
#define IOCTL_KLDDEV_SET_BACKLIGHT            \
    CTL_CODE(FILE_DEVICE_UNKNOWN, 4030, METHOD_BUFFERED, FILE_ANY_ACCESS)

BOOL DllEntry(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved);

DWORD Init(DWORD Context);

BOOL Deinit(DWORD Context);

DWORD Open(DWORD Context, DWORD Access, DWORD ShareMode);

BOOL Close(DWORD Context);

DWORD Read(DWORD dwContext, LPVOID pBuf, DWORD Len);

DWORD Write(DWORD dwContext, LPVOID pBuf, DWORD Len);

VOID PowerDown(DWORD dwContext);

VOID PowerUp(DWORD dwContext);
 
BOOL IOControl(DWORD dwContext, DWORD Ioctl, PUCHAR pInBuf, DWORD InBufLen, 
	       PUCHAR pOutBuf, DWORD OutBufLen, PDWORD pdwBytesTransferred);
 
///////////////////////////////////////////////////////////////////////////////

#endif
